<?php
namespace app\api\controller\food;

use hema\wechat\Pay as WxPay;
use app\api\model\food\Order as OrderModel;
use app\api\model\food\Record as RecordModel;
use app\api\model\food\User as UserModel;


/**
 * 支付成功异步通知接口
 */
class Notify
{
    /**
     * 订单支付- 直连商户
     */
    public function order($appletid='')
    {
		$WxPay = new WxPay([]);
        $WxPay->notify(new OrderModel,$appletid);
    }
    /**
     * 订单退款
     */
    public function orderRefund($appletid='')
    {
        $WxPay = new WxPay([]);
        $WxPay->refundsNotify(new OrderModel,$appletid);
    }
    /**
     * 会员充值
     */
    public function recharge($appletid='')
    {
        $WxPay = new WxPay([]);
        $WxPay->notify(new RecordModel,$appletid,'add');
    }
    
    /**
     * 开通会员
     */
    public function openvip($appletid='')
    {
        $WxPay = new WxPay([]);
        $WxPay->notify(new UserModel,$appletid,'add');
    }

}
